

package com.yq.generic;

import java.lang.reflect.ParameterizedType;

/**
 * Simple to Introduction
 * className: ClassDemo
 *
 * @author YangQian
 * @version 2018/4/16 16:43
 */
public class ClassDemo <T extends IntA> {
    public String getClassInfo(T t) {
        Class<T> domainClass = (Class<T>) ((ParameterizedType) t.getClass().getGenericSuperclass()).getActualTypeArguments()[0];

        return domainClass != null? domainClass.getSimpleName(): null;
    }
}
